package com.starleague.battletech.hexagonal;

import com.starleague.battletech.game.AbstractBattletechGame;
import com.starleague.hexagonal.HexOutOfBoundsException;
import com.starleague.hexagonal.IHexCoordinate;
import com.starleague.hexagonal.flat.AbstractFlatHexGrid;

public abstract class AbstractBattletechHexGrid
        extends AbstractFlatHexGrid
        implements IBattletechHexGrid
{
    private AbstractBattletechGame game;

    protected AbstractBattletechHexGrid(AbstractBattletechGame game,
                                        int minGridX,
                                        int minGridY,
                                        int numHexesX,
                                        int numHexesY)
    {
        super(minGridX, minGridY, numHexesX, numHexesY);
        this.game = game;
    }

    protected AbstractBattletechHexGrid()
    {
        //
    }

    @Override
    public AbstractBattletechGame getGame()
    {
        return this.game;
    }

    @Override
    public AbstractBattletechHex getHexAt(IHexCoordinate hexCoordinate) throws HexOutOfBoundsException
    {
        return (AbstractBattletechHex) super.getHexAt(hexCoordinate);
    }
}
